#pragma once

#include <iostream>

using namespace std;

class Base
{
public:
    Base(){};
    virtual ~Base(){};

public:
    virtual void func() = 0;
};

class Proxy : public Base
{
public:
    Proxy(Base *pBase)
    {
        m_pBase = pBase;
    }
    ~Proxy()
    {
        delete m_pBase;
    }

public:
    void func()
    {
        m_pBase->func();
    }

private:
    Base *m_pBase;
};

class ProxyA : public Base
{
public:
    ProxyA(){};
    ~ProxyA(){};

public:
    void func()
    {
        cout << "A" << endl;
    };
};

class ProxyB : public Base
{
public:
    ProxyB(){};
    ~ProxyB(){};

public:
    void func()
    {
        cout << "B" << endl;
    };
};
